Micron Document
Fox's Git Mirrors

Node / rns-mirrors / Reticulum-Go.git / files / scripts / ci / setup-tinygo.sh

Displaying Raw • Download

scripts/ci/setup-tinygo.sh 9eb1d8a4a2c2fa7c16a4586f6227eaf9f617c5cc (9eb1d8a4) Text, 736 B

#!/bin/sh
# Install TinyGo .deb from GitHub releases with optional SHA256 pin (TINYGO_DEB_SHA256).
# Usage: setup-tinygo.sh <version> [arch]
set -eu

. "$(dirname "$0")/priv.sh"

VER="${1:?}"
ARCH="${2:-amd64}"
DEB="tinygo_${VER}_${ARCH}.deb"
URL="https://github.com/tinygo-org/tinygo/releases/download/v${VER}/${DEB}"

curl -fsSL -o /tmp/tinygo.deb "$URL"

if [ -n "${TINYGO_DEB_SHA256:-}" ]; then
ACTUAL="$(sha256sum /tmp/tinygo.deb | awk '{print $1}')"
if [ "$ACTUAL" != "$TINYGO_DEB_SHA256" ]; then
echo "SHA256 mismatch for TinyGo ${DEB}" >&2
rm -f /tmp/tinygo.deb
exit 1
fi
fi

run_priv dpkg -i /tmp/tinygo.deb 2>/dev/null || run_priv apt-get install -f -y
rm -f /tmp/tinygo.deb
tinygo version

Served by rngit 1.5.2 - Generated in 0.02s